
'use strict'

class getguanzhu{
    constructor(){
       this.param = '/'

    }

    async get(c){
         c.setHeader('content-type', 'text/html; charset=utf-8');
         let a = c.service.fun;
         let {user_id} = c.query;

         let data1 = await a.sel('follow_list',{'follow_id':`${user_id}`},['followed_id'],c.service.pool);
         let data = [];
         //console.log(data1.rows[0])
         //let {followed_id} = data1.rows[0];
         //console.log(followed_id)
         for (var i=0;i<data1.rows.length;i++){
             let aa = await a.sel('user_list',{'user_id':`${data1.rows[i].followed_id}`},['user_head','user_name','user_self','user_id'],c.service.pool);
             let {user_head,user_name,user_self,user_id} = aa.rows[0];
             data.push({user_head,user_name,user_self,user_id});
         }
         c.send({
             type:'array',
             data:data
         })
    }
}

module.exports = getguanzhu
